import requests

# 重定向
url = 'http://localhost/smeoa/index.php?m=login&a=check_login'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
datas = {'emp_no': 'admin', 'password': 'admin'}
r = requests.post(url, data=datas, allow_redirects=False)
print(r.text)

# 重定向历史
url = 'http://localhost/smeoa/index.php?m=login&a=check_login'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
datas = {'emp_no': 'admin', 'password': 'admin'}
r = requests.post(url, data=datas)
print(r.history)
print(r.status_code)
